{template '_header'}
<script>document.title = "{$page_title}";</script>
<link rel="stylesheet" type="text/css" href="../addons/ewei_shopv2/plugin/seckill/template/mobile/default/static/css/common.css">
<div class="fui-page seckill-page">
    {if is_h5app()}
        <div class="fui-header">
            <div class="fui-header-left">
                <a class="back"></a>
            </div>
            <div class="title">{$page_title}</div>
            <div class="fui-header-right"></div>
        </div>
    {/if}
    <div class="fui-content navbar">

    </div>
    {php $this->footerMenus()}
</div>
<script type="text/html" id="tpl_seckill">

    <div class="fui-list-group time-group-<%time.id%>" style="margin-top:0px">
        <div class="fui-list-group-title">
            <%if time.status>=0%>
             <span class="timer">
                  <%if time.status==1%>距开始<%else%>距结束<%/if%> <span class="time-hour">-</span>:<span class="time-min">-</span>:<span class="time-sec">-</span>
             </span>
            <%/if%>
            <%if time.status==-1%>还可以继续抢购哦~<%/if%>
            <%if time.status==0%>抢购中 先下单先得哦<%/if%>
            <%if time.status==1%>即将开始 先下单先得哦<%/if%>

        </div>

        <%each goods as g%>
        <div class='fui-list align-start'>
            <div class='fui-list-media'>
                <img src="<%g.thumb%>" />
            </div>
            <div class='fui-list-inner'>
                <div class='text'><%g.title%></div>
                <div class="info">
                     <span class="button">
                         <%if time.status==1%>
                         <a href="{php echo mobileUrl('goods/detail')}&id=<%g.goodsid%>" class="btn btn-success btn-sm">等待抢购</a>

                         <%else%>
                                <%if g.percent>=100%>
                                <a href="{php echo mobileUrl('goods/detail')}&id=<%g.goodsid%>" class="btn btn-default btn-sm">已抢空</a>
                             <%else%>
                         <a href="{php echo mobileUrl('goods/detail')}&id=<%g.goodsid%>" class="btn btn-danger btn-sm">去抢购</a>

                             <%/if%>
                          <%/if%>
                     </span>
                    <div class="price">&yen;<%g.price%></div>
                </div>
                <div class="info info1">
                    <%if time.status!=1%>
                        <span class="process">
                                <div class="inner" style="width:<%g.percent%>%"></div>
                        </span>
                    <span class="process-text">已售 <%g.percent%>%</span>
                    <%/if%>
                    <div class="price1">&yen;<%g.marketprice%></div>
                </div>
            </div>
        </div>
        <%/each%>
 </div>

</script>
    <script language="javascript">
            require(['../addons/ewei_shopv2/plugin/seckill/static/js/mobile.js'], function(model){
                model.init({taskid:{$taskid},roomid:{$roomid},timeid: {$timeid}, roomindex:{$roomindex}, roomcount: {php echo count($rooms)} , timeindex:{$timeindex},  timecount: {php echo count($times)} , advcount:{php echo count($advs)}  });
            });
</script>
{template '_footer'}